package cn.sirun.com.fca.account.repo.bind;


import com.tencent.cloud.iov.kernel.constant.ApiConst;
import com.tencent.cloud.iov.kernel.model.BaseResponse;
import com.tencent.cloud.iov.kernel.service.ServiceGenerator;

import cn.sirun.com.fca.account.model.base.CarInfoDetailRequest;
import cn.sirun.com.fca.account.model.base.CarInfoDetailResponse;
import cn.sirun.com.fca.account.model.bind.PinSetFirstRequest;
import cn.sirun.com.fca.account.model.bind.PinSetFirstResponse;
import cn.sirun.com.fca.account.model.bind.PinSetParamResponse;
import cn.sirun.com.fca.account.model.bind.PinSetParamsRequest;
import cn.sirun.com.fca.account.model.bind.RecognizePicRequest;
import cn.sirun.com.fca.account.model.bind.RecognizePicResponse;
import cn.sirun.com.fca.account.model.bind.SubmitCarAuthenticationRequest;
import cn.sirun.com.fca.account.model.bind.SubmitCarAuthenticationResponse;
import cn.sirun.com.fca.account.model.bind.SubmitOwnerInfoRequest;
import cn.sirun.com.fca.account.model.bind.SubmitPersonalInfoRequest;
import cn.sirun.com.fca.account.model.bind.SubmitPersonalInfoResponse;
import cn.sirun.com.fca.account.model.bind.VerifyPinRequest;
import cn.sirun.com.fca.account.model.bind.VerifyPinResponse;
import io.reactivex.Observable;

/**
 * @author vinsonhuang
 * @date 2018/5/8
 */

public class BindRepository {

    private static volatile BindRepository sInstance;

    public static BindRepository getInstance() {
        if (sInstance == null) {
            synchronized (BindRepository.class) {
                if (sInstance == null) {
                    sInstance = new BindRepository();
                }
            }
        }

        return sInstance;
    }

    private final BindService mBindService;

    private BindRepository() {
        mBindService = ServiceGenerator.createService(BindService.class, ApiConst.getBaseUrl());
    }

    public Observable<BaseResponse<RecognizePicResponse>> recognizePic(
            RecognizePicRequest request) {
        return mBindService.recognizePic(request);
    }



    public Observable<BaseResponse<Void>> submitOwnerInfo(SubmitOwnerInfoRequest request) {
        return mBindService.submitOwnerInfo(request);
    }




    public Observable<BaseResponse<RecognizePicResponse>> submitOwnerImg(SubmitOwnerInfoRequest request) {
        return mBindService.submitOwnerImg(request);
    }



    public Observable<BaseResponse<CarInfoDetailResponse>> getCarInfoDetail(CarInfoDetailRequest request) {
        return mBindService.getCarInfoDetail(request);
    }

    public Observable<BaseResponse<SubmitPersonalInfoResponse>> submitPersonInfo(SubmitPersonalInfoRequest request) {
        return mBindService.submitPersonInfo(request);
    }

    public Observable<BaseResponse<SubmitCarAuthenticationResponse>> submitCarAuthentication(SubmitCarAuthenticationRequest request) {
        return mBindService.submitCarAuthentication(request);
    }

}
